import 'package:flutter/material.dart';

final customCheckboxTheme = CheckboxThemeData(
  shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)),
  
  // 在这里使用 MaterialStateProperty 来定义 side
  side: WidgetStateBorderSide.resolveWith(
    (states) {
      if (states.contains(WidgetState.selected)) {
        // 对于主题，我们可以让选中时的边框透明，完全依赖 fillColor
        return const BorderSide(color: Colors.transparent);
      }
      // 未选中时的边框颜色
      return const BorderSide(color: Color(0xFFCCCCCC), width: 1.5);
    },
  ),
  
  // 也可以在这里统一配置填充色
  fillColor: WidgetStateProperty.resolveWith(
    (states) {
      if (states.contains(WidgetState.selected)) {
        return Color(0xFF6758D4); 
      }
      return Colors.transparent;
    },
  ),
);